using System.IO;

namespace CodePlex.CodePlexClientLibrary
{
    [Command("makepatch", "Create a patch file.", MinArgs = 1, MaxArgs = 1, UsageSummary = "<filename> [options]",
        UsageDescription = @"Creates the specified patch file.  The patch file will contain all changes
in the current directory and all sub-directories.")]
    public class MakePatchCommand : NonAuthenticatedCommand
    {
        readonly MakePatchConsoleView view;

        public MakePatchCommand(MakePatchConsoleView view)
        {
            this.view = view;
        }

        public override void Execute()
        {
            string filename = Path.GetFullPath(Arguments[0]);
            view.Run(Directory.GetCurrentDirectory(), filename);
        }
    }
}